<?php

class main_controller extends Hardy_controller
{
	public function exec()
	{
		global $Hardy_config;

		$this->model = Hardy_get_class('post', 'model');
		$this->model->connect();
		if(isset($_POST['content']))
		{
			$this->model->new_post($_POST['content']);
		}
		
		$this->data['data'] = $this->model->get_posts();
		$this->data['rootUrl'] = $Hardy_config['base_url'];
		$this->data['user'] = @$_COOKIE['HardyBBS'];
		$this->model->close();
		
		$this->view = new Hardy_view();
		$this->view->render($this->data);
	}
}

?>